
<!-- saved from url=(0066)http://code.google.com/p/psutil/wiki/DocumentationDev?show=content -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>DocumentationDev</title>
 <script>window["_GOOG_TRANS_EXT_VER"] = "1";</script></head>
 <body>



<div>
<table>
 <tbody><tr>


 <td style="vertical-align:top;">

 <div id="wikicontent">
 <div class="vt" id="wikimaincol">
 <h1><a name="API_Reference"></a>API Reference<a href="http://code.google.com/p/psutil/wiki/DocumentationDev?show=content#API_Reference" class="section_anchor"></a></h1><h2><a name="Exceptions"></a>Exceptions<a href="http://code.google.com/p/psutil/wiki/DocumentationDev?show=content#Exceptions" class="section_anchor"></a></h2><p>psutil.<strong>NoSuchProcess<a href="http://code.google.com/p/psutil/w/edit/NoSuchProcess">?</a></strong><font size="3"><strong><tt>(</tt></strong></font><i>pid, name=None, msg=None</i><font size="3"><strong><tt>)</tt></strong></font> </p><blockquote>Raised when no process with the given PID is found in the current process list or when a process no longer exists (zombie).
</blockquote><p></p><blockquote><i><strong>Changed in 0.2.0:</strong> <tt>pid</tt>, <tt>name</tt> and <tt>msg</tt> arguments were added</i>
</blockquote><p>psutil.<strong>AccessDenied<a href="http://code.google.com/p/psutil/w/edit/AccessDenied">?</a></strong><font size="3"><strong><tt>(</tt></strong></font><i>pid=None, name=None, msg=None</i><font size="3"><strong><tt>)</tt></strong></font> </p><blockquote>Raised when permission to perform an action is denied.
</blockquote><p></p><blockquote><i><strong>Changed in 0.2.0:</strong> <tt>pid</tt>, <tt>name</tt> and <tt>msg</tt> arguments were added </i>
</blockquote><p>psutil.<strong>TimeoutExpired<a href="http://code.google.com/p/psutil/w/edit/TimeoutExpired">?</a></strong><font size="3"><strong><tt>(</tt></strong></font><i>pid=None, name=None</i><font size="3"><strong><tt>)</tt></strong></font> </p><blockquote>Raised on <tt>Process.wait(timeout)</tt> if timeout expires and process is still alive.
</blockquote><p></p><blockquote><i><strong>New in 0.2.1</strong></i>
</blockquote><hr><h2><a name="Classes"></a>Classes<a href="http://code.google.com/p/psutil/wiki/DocumentationDev?show=content#Classes" class="section_anchor"></a></h2><p>psutil.<strong>Process</strong><font size="3"><strong><tt>(</tt></strong></font><i>pid</i><font size="3"><strong><tt>)</tt></strong></font> </p><blockquote>A class which represents an OS process.
</blockquote><ul><li><strong>pid</strong><br>The process pid. </li></ul><ul><li><strong>ppid</strong><br>The process parent pid. </li></ul><ul><li><strong>parent</strong><br>Return the parent process as a <tt>Process</tt> object. If no ppid is known then return <tt>None</tt>. </li></ul><ul><li><strong>name</strong><br>The process name. </li></ul><ul><li><strong>exe</strong><br>The process executable as an absolute path name. </li></ul><blockquote><i><strong>New in 0.2.0</strong></i>
</blockquote><ul><li><strong>cmdline</strong><br>The command line process has been called with. </li></ul><ul><li><strong>path</strong><br>The process path.  </li></ul><blockquote><i><strong>Deprecated in 0.2.0</strong></i>
</blockquote><ul><li><strong>create_time</strong><br> The process creation time as a floating point number expressed in seconds since the epoch, in <a href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time" rel="nofollow">UTC</a>. </li></ul><ul><li><strong>uids</strong><br>The <i>real</i>, <i>effective</i> and <i>saved</i> user ids of the current process as a nameduple. This is the same as <a href="http://docs.python.org/library/os.html#os.getresuid" rel="nofollow">os.getresuid()</a> but per-process.  </li></ul><blockquote><i><strong>New in 0.2.1</strong></i><br><strong><i>Availability:</i></strong><i> UNIX</i>
</blockquote><ul><li><strong>gids</strong><br>The <i>real</i>, <i>effective</i> and <i>saved</i> group ids of the current process as a nameduple. This is the same as <a href="http://docs.python.org/library/os.html#os.getresgid" rel="nofollow">os.getresgid()</a> but per-process.  </li></ul><blockquote><i><strong>New in 0.2.1</strong></i><br><i><strong>Availability:</strong> UNIX</i>
</blockquote><ul><li><strong>uid</strong><br>The <i>real</i> user id of the current process. This is the same as <a href="http://docs.python.org/library/os.html#os.getuid" rel="nofollow">os.getuid()</a> but per-process. On Windows always return <tt>-1</tt>. </li></ul><blockquote><i><strong>Deprecated in 0.2.1:</strong> use uids property instead.</i>
</blockquote><ul><li><strong>gid</strong><br>The <i>real</i> group id of the current process. This is the same as <a href="http://docs.python.org/library/os.html#os.getuid" rel="nofollow">os.getgid()</a> but per-process. On Windows always return <tt>-1</tt>. </li></ul><blockquote><i><strong>Deprecated in 0.2.1:</strong> use gids property instead.</i>
</blockquote><ul><li><strong>username</strong><br>The name of the user that owns the process. On UNIX this is calculated by using <i>real</i> process uid. </li></ul><blockquote><i><strong>Changed in 2.0:</strong> Windows implementation has been rewritten in C for performace and <a href="http://sourceforge.net/projects/pywin32/" rel="nofollow">pywin32</a> extension is no longer required.</i>
</blockquote><ul><li><strong>status</strong><br>The current process status. The return value is one of the <tt>STATUS_*</tt> constants, which is an integer that can be used in conjunction with str() to obtain a human-readable form of the current process status. Example: </li><pre class="prettyprint">&gt;&gt;&gt; import psutil, os
&gt;&gt;&gt; p = psutil.Process(os.getpid())
&gt;&gt;&gt; p.status
0
&gt;&gt;&gt; p.status == psutil.STATUS_RUNNING
True
&gt;&gt;&gt; str(p.status)
'running'
&gt;&gt;&gt; </pre></ul><blockquote><i><strong>New in 2.1</strong></i>
</blockquote><ul><li><strong>nice</strong><br>Get or set process <a href="http://blogs.techrepublic.com.com/opensource/?p=140" rel="nofollow">niceness</a> (priority). On UNIX this is a number which usually goes from -20 to 20. The higher the nice value, the lower the priority of the process.   </li><pre class="prettyprint">&gt;&gt;&gt; p = psutil.Process(os.getpid())
&gt;&gt;&gt; p.nice
0
&gt;&gt;&gt; p.nice = 10  # set/change process priority
&gt;&gt;&gt; p.nice
10</pre></ul><blockquote>On Windows this is available as well by using <a href="http://msdn.microsoft.com/en-us/library/ms683211(v=vs.85).aspx" rel="nofollow">GetPriorityClass</a> and <a href="http://msdn.microsoft.com/en-us/library/ms686219(v=vs.85).aspx" rel="nofollow">SetPriorityClass</a>. <tt>psutil.*_PRIORITY_CLASS</tt> constants (explained <a href="http://msdn.microsoft.com/en-us/library/ms686219(v=vs.85).aspx" rel="nofollow">here</a>) can be used in conjunction. Example which increases process priority:
</blockquote><blockquote><pre class="prettyprint">&gt;&gt; p.nice = psutil.HIGH_PRIORITY_CLASS</pre>
</blockquote><blockquote><i><strong>New in 2.1</strong></i>
</blockquote><ul><li><strong>getcwd</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return a string representing the process current working directory. </li></ul><blockquote><i><strong>Availability:</strong> Windows, Linux</i>
</blockquote><ul><li><strong>get_io_counters</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return process I/O statistics as a namedtuple including the number of read and write operations performed by the process and the amount of bytes read and written. For linux refer to <a href="http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#1304" rel="nofollow">/proc filesysem documentation</a>. On BSD there's apparently no way to retrieve bytes counters, hence <tt>-1</tt> is returned for <tt>read_bytes</tt> and <tt>write_bytes</tt> fields. OSX is not supported. </li><pre class="prettyprint">&gt;&gt;&gt; p.get_io_counters()
io(read_count=454556, write_count=3456, read_bytes=110592, write_bytes=0)</pre></ul><blockquote><i><strong>New in 2.1</strong></i><br><i><strong>Availability:</strong> Linux, Windows, FreeBSD</i>
</blockquote><ul><li><strong>get_ionice</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return <a href="http://friedcpu.wordpress.com/2007/07/17/why-arent-you-using-ionice-yet/" rel="nofollow">process I/O niceness</a> (priority) as a namedtuple including priority class and priority data. See <tt>set_ionice</tt> below for more information. </li></ul><blockquote><i><strong>New in 2.1</strong></i><br><i><strong>Availability:</strong> Linux</i>
</blockquote><ul><li><strong>set_ionice</strong><font size="3"><strong><tt>(</tt></strong></font><i>ioclass, iodata=None</i><font size="3"><strong><tt>)</tt></strong></font><br>Change <a href="http://friedcpu.wordpress.com/2007/07/17/why-arent-you-using-ionice-yet/" rel="nofollow">process I/O niceness</a> (priority). <i>ioclass</i> is one of the <strong><tt>IOPRIO_CLASS_*</tt></strong> constants. <i>iodata</i> is a number which goes from 0 to 7. The higher <i>iodata</i> value, the lower the I/O priority of the process. For further information refer to <a href="http://linux.die.net/man/1/ionice" rel="nofollow">ionice</a> command line utility or <a href="http://linux.die.net/man/2/ioprio_set" rel="nofollow">ioprio_set</a> system call. The example below sets IDLE priority class for the current process, meaning it will only get I/O time when no other process needs the disk: </li><pre class="prettyprint">&gt;&gt;&gt; import psutil, os
&gt;&gt;&gt; p = psutil.Process(os.getpid())
&gt;&gt;&gt; p.set_ionice(psutil.IOPRIO_CLASS_IDLE)
&gt;&gt;&gt; </pre></ul><blockquote><i><strong>New in 2.1</strong></i><br><i><strong>Availability:</strong> Linux</i>
</blockquote><ul><li><strong>get_num_threads</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return the number of threads used by this process. </li></ul><blockquote><i><strong>New in 0.2.0</strong></i>
</blockquote><ul><li><strong>get_threads</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return threads opened by process as a list of namedtuples including thread id and thread CPU times (user/system). </li></ul><blockquote><i><strong>New in 0.2.1</strong></i>
</blockquote><ul><li><strong>get_cpu_times</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return a tuple whose values are process CPU user and system times which means the amount of time expressed in seconds that a process has spent in <a href="http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1" rel="nofollow">user/system mode</a>. </li></ul><ul><li><strong>get_cpu_percent</strong><font size="3"><strong><tt>(</tt></strong></font><i>interval=0.1</i><font size="3"><strong><tt>)</tt></strong></font><br>Return a float representing the process CPU utilization as a percentage. When interval is &gt; 0.0 compares process times to system CPU times elapsed before and after the interval (blocking). When interval is 0.0 or None compares process times to system CPU times elapsed since last call, returning immediately. In this case is recommended for accuracy that this function be called with at least 0.1 seconds between calls. </li></ul><blockquote><i><strong>Changed in 0.2.0:</strong> interval parameter was added</i>
</blockquote><ul><li><strong>get_memory_info</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return a tuple representing <a href="http://en.wikipedia.org/wiki/Resident_Set_Size" rel="nofollow">RSS</a> (Resident Set Size) and VMS (Virtual Memory Size) in bytes.<br>On UNIX RSS and VMS are the same values shown by ps. On Windows RSS and VMS refer to "Mem Usage" and "VM Size" columns of taskmgr.exe. </li></ul><ul><li><strong>get_memory_percent</strong><font size="3"><strong><tt>()</tt></strong></font><br>Compare physical system memory to process resident memory and calculate process memory utilization as a percentage. </li></ul><ul><li><strong>get_children</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return the children of this process as a list of <tt>Process</tt> objects. </li></ul><blockquote><i><strong>New in 0.2.0</strong></i>
</blockquote><ul><li><strong>get_open_files</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return files opened by process as a list of <a href="http://docs.python.org/library/collections.html?highlight=namedtuple#collections.namedtuple" rel="nofollow">namedtuples</a> including file absolute path name and file descriptor. On <strong>FreeBSD</strong> this is done by parsing <a href="http://en.wikipedia.org/wiki/Lsof" rel="nofollow">lsof</a> command output. If lsof is not installed on the system <a href="http://docs.python.org/library/exceptions.html?highlight=notimplementederror#exceptions.NotImplementedError" rel="nofollow">NotImplementedError</a> exception is raised.  Example: </li><pre class="prettyprint">&gt;&gt;&gt; import psutil, os
&gt;&gt;&gt; f = open('file.ext', 'w')
&gt;&gt;&gt; psutil.Process(os.getpid()).get_open_files()
[openfile(path='/home/giampaolo/svn/psutil/file.ext', fd=3)]</pre></ul><blockquote><i><strong>New in 0.2.0</strong></i><br>
<i><strong>Changed in 0.2.1:</strong> OSX implementation rewritten in C; no longer requiring lsof.</i>
</blockquote><ul><li><strong>get_connections</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return all TCP and UPD connections opened by process as a list of <a href="http://docs.python.org/library/collections.html?highlight=namedtuple#collections.namedtuple" rel="nofollow">namedtuples</a>. Every namedtuple provides 6 attributes:<br><br> </li><ul><li><strong>fd</strong>: the socket file descriptor. This can be passed to <a href="http://docs.python.org/library/socket.html#socket.fromfd" rel="nofollow">socket.fromfd</a> to obtain a usable socket object. This is only available on UNIX; on Windows <tt>-1</tt> is always returned.<br> </li><li><strong>family</strong>: the address family, either <a href="http://docs.python.org/library/socket.html#socket.AF_INET" rel="nofollow">AF_INET</a> or <a href="http://docs.python.org/library/socket.html#socket.AF_INET6" rel="nofollow">AF_INET6</a> <br> </li><li><strong>type</strong>: the address type, either <a href="http://docs.python.org/library/socket.html#socket.SOCK_STREAM" rel="nofollow">SOCK_STREAM</a> or <a href="http://docs.python.org/library/socket.html#socket.SOCK_DGRAM" rel="nofollow">SOCK_DGRAM</a> <br> </li><li><strong>local_address</strong>: the local address as a <tt>(ip, port)</tt> tuple. <br> </li><li><strong>remote_address</strong>: the remote address as a <tt>(ip, port)</tt> tuple. When the remote endpoint is not connected the tuple is empty. <br> </li><li><strong>status</strong>: a string representing the TCP connections status. String values are supposed to match Linux's <a href="http://students.mimuw.edu.pl/lxr/source/include/net/tcp_states.h" rel="nofollow">tcp_states.h</a> header file across all platforms. For UDP sockets this is always going to be an empty string.<br> </li></ul></ul><blockquote>Example:
<pre class="prettyprint">&gt;&gt;&gt; p = psutil.Process(1694)
&gt;&gt;&gt; p.name
'firefox'
&gt;&gt;&gt; p.get_connections()
[connection(fd=115, family=2, type=1, local_address=('10.0.0.1', 48776), remote_address=('93.186.135.91', 80), status='ESTABLISHED'),
 connection(fd=117, family=2, type=1, local_address=('10.0.0.1', 43761), remote_address=('72.14.234.100', 80), status='CLOSING'),
 connection(fd=119, family=2, type=1, local_address=('10.0.0.1', 60759), remote_address=('72.14.234.104', 80), status='ESTABLISHED'),
 connection(fd=123, family=2, type=1, local_address=('10.0.0.1', 51314), remote_address=('72.14.234.83', 443), status='SYN_SENT')]</pre>On <strong>FreeBSD</strong> this is implemented by parsing <a href="http://en.wikipedia.org/wiki/Lsof" rel="nofollow">lsof</a> command output. If lsof is not installed on the system <a href="http://docs.python.org/library/exceptions.html?highlight=notimplementederror#exceptions.NotImplementedError" rel="nofollow">NotImplementedError</a> exception is raised and for third party processes (different than <tt>os.getpid()</tt>) results can differ depending on user privileges.<br>
</blockquote><blockquote><i><strong>New in 0.2.0</strong></i><br>
<i><strong>Changed in 0.2.1:</strong> OSX implementation rewritten in C; no longer requiring lsof.</i>
</blockquote><ul><li><strong>is_running</strong><font size="3"><strong><tt>()</tt></strong></font><br>Return whether the current process is running in the current process list. </li></ul><ul><li><strong>send_signal</strong><font size="3"><strong><tt>(</tt></strong></font><i>signal</i><font size="3"><strong><tt>)</tt></strong></font><br>Send a signal to process (see <a href="http://docs.python.org/library/signal.html" rel="nofollow">signal module</a> constants). On Windows only <tt>SIGTERM</tt> is valid and is treated as an alias for <tt>kill()</tt>. </li></ul><blockquote><i><strong>New in 0.2.0</strong></i>
</blockquote><ul><li><strong>suspend</strong><font size="3"><strong><tt>()</tt></strong></font><br>Suspend process execution with <tt>SIGSTOP</tt> signal. On Windows this is done by suspending all process threads execution. </li></ul><ul><li><strong>resume</strong><font size="3"><strong><tt>()</tt></strong></font><br>Resume process execution with <tt>SIGCONT</tt> signal. On Windows this is done by resuming all process threads execution. </li></ul><ul><li><strong>terminate</strong><font size="3"><strong><tt>()</tt></strong></font><br>Terminate the process with <tt>SIGTERM</tt> signal. On Windows this is an alias for <tt>kill()</tt>. </li></ul><blockquote><i><strong>New in 0.2.0</strong></i>
</blockquote><ul><li><strong>kill</strong><font size="3"><strong><tt>()</tt></strong></font><br>Kill the current process by using <tt>SIGKILL</tt> signal. </li></ul><blockquote><i><strong>Changed in 0.2.0:</strong> no longer accepts <tt>sig</tt> keyword argument - use <tt>send_signal()</tt> instead. </i>
</blockquote><ul><li><strong>wait</strong><font size="3"><strong><tt>(</tt></strong></font><i>timeout=None</i><font size="3"><strong><tt>)</tt></strong></font><br>Wait for process termination and if the process is a children of the current one also return the exit code, else <tt>None</tt>. On Windows there's no such limitation (exit code is always returned). If the process is already terminated does not raise <tt>NoSuchProcess</tt> exception but just return <tt>None</tt> immediately. If <i>timeout</i> is specified and process is still alive raises <tt>TimeoutExpired</tt> exception. </li></ul><blockquote><i><strong>New in 0.2.1</strong></i>
</blockquote><p><br><br> psutil.<strong>Popen</strong><font size="3"><strong><tt>(</tt></strong></font><tt>*args, **kwargs</tt><font size="3"><strong><tt>)</tt></strong></font> </p><blockquote>A more convenient interface to stdlib <a href="http://docs.python.org/library/subprocess.html#subprocess.Popen" rel="nofollow">subprocess.Popen</a>. It starts a sub process and deals with it exactly as when using subprocess.Popen class but in addition also provides all the properties and methods of psutil.Process class in a unique interface. For method names common to both classes such as <i>kill()</i> and <i>terminate()</i>, psutil.Process implementation takes precedence. For a complete documentation refers to <a href="http://docs.python.org/library/subprocess.html" rel="nofollow">subprocess module documentation</a>.
</blockquote><blockquote><i><strong>New in 0.2.1</strong></i>
</blockquote><hr><h2><a name="Functions"></a>Functions<a href="http://code.google.com/p/psutil/wiki/DocumentationDev?show=content#Functions" class="section_anchor"></a></h2><p>psutil.<strong>get_pid_list</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return a list of current running PIDs.
</blockquote><p></p><p>psutil.<strong>pid_exists</strong><font size="3"><strong><tt>(</tt></strong></font><i>pid</i><font size="3"><strong><tt>)</tt></strong></font><br> </p><blockquote>Check whether the given PID exists in the current process list. This is faster than doing <tt>pid in psutil.get_pid_list()</tt> and should be preferred.
</blockquote><p></p><p>psutil.<strong>process_iter</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return an iterator yielding a Process class instances for all running processes on the local machine. This should be preferred over doing <tt>for pid in psutil.get_pid_list(): psutil.Process(pid)</tt> as it safe from race conditions.
</blockquote><p></p><hr><h2><a name="System_related_objects"></a>System related objects<a href="http://code.google.com/p/psutil/wiki/DocumentationDev?show=content#System_related_objects" class="section_anchor"></a></h2><p>psutil.<strong>cpu_percent</strong><font size="3"><strong><tt>(</tt></strong></font><i>interval=0.1</i><font size="3"><strong><tt>)</tt></strong></font><br> </p><blockquote>Return a float representing the current system-wide CPU utilization as a percentage. When interval is &gt; 0.0 compares system CPU times elapsed before and after the interval (blocking). When interval is 0.0 or None compares system CPU times elapsed since last call or module import, returning immediately. In this case is recommended for accuracy that this function be called with at least 0.1 seconds between calls.
</blockquote><p></p><blockquote><i><strong>Changed in 0.2.0:</strong> interval parameter was added</i>
</blockquote><p>psutil.<strong>cpu_times</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return system CPU times as a namedtuple. Every CPU time is accessible in form of a <tt>CPUTimes</tt> attribute and represents the time CPU has spent in the given mode.<br>The attributes availability varies depending on the platform.  Here follows a list of all available attributes:
</blockquote><p></p><blockquote>- <strong>user</strong><br>
- <strong>system</strong><br>
- <strong>idle</strong><br>
- <strong>nice</strong> <i>(UNIX)</i><br>
- <strong>iowait</strong> <i>(Linux)</i><br>
- <strong>irq</strong> <i>(Linux, FreeBSD)</i><br>
- <strong>softirq</strong> <i>(Linux)</i><br>
</blockquote><p>psutil.<strong>avail_phymem</strong><font size="3"><strong><tt>()</tt></strong></font><br> psutil.<strong>used_phymem</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return the amount of available and used physical memory on the system, in bytes. For total physical memory use <tt>psutil.BOOT_TIME</tt> constant.
</blockquote><p></p><p>psutil.<strong>total_virtmem</strong><font size="3"><strong><tt>()</tt></strong></font><br> psutil.<strong>avail_virtmem</strong><font size="3"><strong><tt>()</tt></strong></font><br> psutil.<strong>used_virtmem</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return the amount of total, available and used virtual memory on the system, in bytes.<br>On Linux they match the values returned by <tt>free</tt> command line utility. On OS X and FreeBSD they represent the same values as returned by <tt>sysctl vm.vmtotal</tt>. On Windows they are determined by reading the <tt>*PageFile</tt> values of <a href="http://msdn.microsoft.com/en-us/library/aa366770(VS.85).aspx" rel="nofollow">MEMORYSTATUSEX</a> structure.
</blockquote><p></p><p>psutil.<strong>cached_phymem</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return the amount of cached memory on the system, in bytes. This reflects the "cached" column of free command line utility on Linux.
</blockquote><p></p><blockquote><i><strong>New in 0.2.0</strong></i><strong><br><i>Availability:</i></strong><i> Linux</i>
</blockquote><p>psutil.<strong>phymem_buffers</strong><font size="3"><strong><tt>()</tt></strong></font><br> </p><blockquote>Return the amount of physical memory buffers used by the kernel in bytes. This reflects the "buffers" column of free command line utility on Linux.
</blockquote><p></p><blockquote><i><strong>New in 0.2.0</strong></i><br><strong><i>Availability:</i></strong><i> Linux</i>
</blockquote><hr><h2><a name="Constants"></a>Constants<a href="http://code.google.com/p/psutil/wiki/DocumentationDev?show=content#Constants" class="section_anchor"></a></h2><p>psutil.<strong>TOTAL_PHYMEM</strong><br> </p><blockquote>The amount of total physical memory on the system, in bytes.
</blockquote><p></p><p>psutil.<strong>NUM_CPUS</strong><br> </p><blockquote>The number of CPUs on the system. This is preferable than using <tt>os.environ['NUMBER_OF_PROCESSORS']</tt> as it is more accurate and always available.
</blockquote><p></p><p>psutil.<strong>BOOT_TIME</strong><br> </p><blockquote>A number indicating the system boot time expressed in seconds since the epoch.
</blockquote><p></p><blockquote><i><strong>New in 0.2.1</strong></i>
</blockquote><p>psutil.<strong>ABOVE_NORMAL_PRIORITY_CLASS</strong><br> psutil.<strong>BELOW_NORMAL_PRIORITY_CLASS</strong><br> psutil.<strong>HIGH_PRIORITY_CLASS</strong><br> psutil.<strong>IDLE_PRIORITY_CLASS</strong><br> psutil.<strong>NORMAL_PRIORITY_CLASS</strong><br> psutil.<strong>REALTIME_PRIORITY_CLASS</strong><br> </p><blockquote>A set of integers representing the priority of a process on Windows (see <a href="http://msdn.microsoft.com/en-us/library/ms686219(v=vs.85).aspx" rel="nofollow">MSDN documentation</a>). They can be used in conjunction with <tt>psutil.Process.nice</tt> to get or set process priority.
</blockquote><p></p><blockquote><i><strong>New in 0.2.1</strong></i><br><i><strong>Availability:</strong> Windows</i>
</blockquote><p>psutil.<strong>IOPRIO_CLASS_NONE</strong><br> psutil.<strong>IOPRIO_CLASS_RT</strong><br> psutil.<strong>IOPRIO_CLASS_BE</strong><br> psutil.<strong>IOPRIO_CLASS_IDLE</strong><br> </p><blockquote>A set of integers representing the I/O priority of a process on Linux. They can be used in conjunction with <tt>psutil.Process.get_ionice()</tt> and <tt>psutil.Process.set_ionice()</tt> to get or set process I/O priority. For further information refer to <a href="http://linux.die.net/man/1/ionice" rel="nofollow">ionice</a> command line utility or <a href="http://linux.die.net/man/2/ioprio_get" rel="nofollow">ioprio_get</a> system call.
</blockquote><p></p><blockquote><i><strong>New in 0.2.1</strong></i><br><i><strong>Availability:</strong> Linux</i>
</blockquote><p>psutil.<strong>STATUS_RUNNING</strong><br> psutil.<strong>STATUS_SLEEPING</strong><br> psutil.<strong>STATUS_DISK_SLEEP</strong><br> psutil.<strong>STATUS_STOPPED</strong><br> psutil.<strong>STATUS_TRACING_STOP</strong><br> psutil.<strong>STATUS_ZOMBIE</strong><br> psutil.<strong>STATUS_DEAD</strong><br> psutil.<strong>STATUS_WAKE_KILL</strong><br> psutil.<strong>STATUS_WAKING</strong><br> psutil.<strong>STATUS_IDLE</strong><br> psutil.<strong>STATUS_LOCKED</strong><br> psutil.<strong>STATUS_WAITING</strong><br> </p><blockquote>A set of integers representing the status of a process. To be used in conjunction with <tt>psutil.Process.status</tt> property. If used with str() return a human-readable status string.
</blockquote><p></p><blockquote><i><strong>New in 0.2.1</strong></i><br><i><strong>
</strong></i></blockquote>
 </div>
 </div>
 </td></tr><tr>
</tr></tbody></table>
 </div>

</body></html>
